package com.cedric.yixianpai.game.cards.Sects.swordCards.b_ZhuJi;

import com.cedric.yixianpai.game.Constants.Period;
import com.cedric.yixianpai.game.Status.DuelStatus;
import com.cedric.yixianpai.game.interfaces.SwordCard;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;

/**
 * 化灵诀
 */
@Component
public class HuaLingJue extends SwordCard {
    /**
     * 化灵诀 +灵气3/4/5
     * @param lvl 1/2/3
     */
    public HuaLingJue(@Value("1") int lvl) {
        super("化灵诀");
        this.setPeriod(Period.ZHUJI);
        this.setDescription("+灵气3/4/5");

        if (1 == lvl) {
            this.setLevel(1);
            this.setSpiritAdd(3);
        } else if (2 == lvl) {
            this.setLevel(2);
            this.setSpiritAdd(4);
        } else if (3 == lvl) {
            this.setLevel(3);
            this.setSpiritAdd(5);
        } else {
            throw new RuntimeException("卡牌等级错误！");
        }
    }

    @Override
    public boolean effect(DuelStatus Sta1, DuelStatus Sta2) {
        Sta1.getPlayerBuff().addSpiritualEnergy(this.getSpiritAdd());
        return true;
    }
}
